package cn.gson.crm.controller.custom;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.CustomDao;

/**
 * 客户删除
 */
@WebServlet("/custom/delete")
public class CustomDeleteServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private CustomDao customDao=new CustomDao();
	

	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String[] ids=request.getParameterValues("id");
		for (String id : ids) {
			//System.out.println(id);
			boolean result=customDao.daleteCustom(id);
			if(!result){
				errorForward("删除失败", "custom/custom.jsp");
				return;
			}
			
		}
		redirect("custom");
	}

	protected void post(HttpServletRequest request, HttpServletResponse response) throws Exception {
	}

}
